package panda.android.notebook.dialog;

import panda.android.notebook.R;
import panda.android.notebook.Utils.Utils;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

public class BaseDialog extends Dialog {

	protected TextView title;
	protected LinearLayout layout;
	protected Utils utils;

	public BaseDialog(Context context) {
		super(context);
		// TODO Auto-generated constructor stub
	}

	public BaseDialog(Context context, int theme) {
		super(context, theme);
		// TODO Auto-generated constructor stub
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		// setCanceledOnTouchOutside(false);
		utils = new Utils();
		setContentView(R.layout.dialog);

		title = (TextView) findViewById(R.id.dialog_title);

		title.setTextSize(new Utils().fontsize(10));
		layout = (LinearLayout) findViewById(R.id.dialog_layout);
		layout.setGravity(Gravity.CENTER);

		WindowManager.LayoutParams layoutParams = getWindow().getAttributes();
		layoutParams.width = utils.width(400);
		layoutParams.height = utils.height(600);
		getWindow().setAttributes(layoutParams);
	}

}
